package com.example.wu5hen.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.content.*;
import android.app.*;

public class DialogAlert extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dialog_alert);
        AlertDialog.Builder dialog=new AlertDialog.Builder(DialogAlert.this);
        dialog.setIcon(android.R.drawable.ic_dialog_info);
        dialog.setTitle("欢迎");
        dialog.setMessage("欢迎使用本程序");
        dialog.setPositiveButton("肯定", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                //
            }
        });
        dialog.setNegativeButton("否定",new DialogInterface.OnClickListener(){
           public void onClick(DialogInterface dialog, int which){

           }
        });
        dialog.create();
        dialog.show();
    }
}
